<script setup lang="ts">
import {onMounted} from "vue";
import useTaskStore from '@/store/task'

const taskStore = useTaskStore()
onMounted(() => {
  console.log("mounted")
})
const msg = new SpeechSynthesisUtterance()  //构建语音合成实例
const synth = window.speechSynthesis
const handler = () => {
  console.log('click')
  // taskStore.WINDOW_NAV_TO("setting","Ab")
  msg.text = "这是一段播放的语音 "
  msg.lang = 'zh-CN'
  msg.volume = 1
  msg.rate = 0.85
  msg.pitch = 1
  synth.speak(msg)
}
</script>
<template>
  <div class="contact" >
    <a-button @click="handler" type="primary">播放1</a-button>
  </div>
</template>
<style lang="less" scoped>
</style>
